package com.google.code.msgbooster.servlet.extension;

import javax.jdo.PersistenceManager;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;

import org.springframework.web.context.support.WebApplicationContextUtils;

import com.google.code.msgbooster.core.Service;
import com.google.code.msgbooster.servlet.Meta;

public final class Startup extends Meta {

	@Override
	public void execute(ServletConfig arg0) throws ServletException {
		Service.setContext(WebApplicationContextUtils
				.getWebApplicationContext(arg0.getServletContext()));
		Service.setPersistenceManager((PersistenceManager) Service.getBean(this
				.getProperty("msgbooster.var.service.persistence.manager")));
	}
}
